window.onload = function() {
    var id = location.href.match(/\id=(\d+)/)[1]
    console.log(id);
    var xhr = new XMLHttpRequest();
    xhr.open('get', 'http://localhost:8888/goods/item?id='+id)
    xhr.send()
    xhr.onreadystatechange = function() {
        if(xhr.readyState === 4) {
            if(parseInt(xhr.status / 100) === 2) {
                var res = xhr.responseText;
                res = JSON.parse(res);
                console.log(res);
                var {code, info} = res;
                if(code === 1) {
                    var str = `
                        
                    `;
                }
            }
        }
    }
}